<?php

class Application_Model_Register {

    private $_dbtable;

    public function __construct() {
        $this->_dbtable = new Application_Model_DbTable_Entries();
    }

    public function createEntry($array) {
        $this->_dbtable->insert($array);        
    }
    
    public function updateEntry($array,$id) {
        $this->_dbtable->update($array,"id=$id");
    }
    
    
    public function getEntry($id) {
        $select = $this->_dbtable->select();
        $select->where('id=?',$id);
        return $this->_dbtable->fetchAll($select);
    }
    
    public function deleteEntry($id) {
        $where = $this->_dbtable->getAdapter()->quoteInto('id = ?', $id);
        $this->_dbtable->delete($where);
    }
    
    public function fetchAll() {
        $selectall = $this->_dbtable->select();
        return $this->_dbtable->fetchAll($selectall) ;
    }
    
    
}

